import 'package:flutter/material.dart';

class Avatar extends StatelessWidget {
  final double size;
  final double avatarSize;
  final String imageURL;
  final bool circle;

  const Avatar(
      {Key? key,
      this.size = 60,
      this.avatarSize = 58,
      required this.imageURL,
      this.circle = false})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Stack(
      alignment: Alignment.center,
      children: [
        Container(
          width: size,
          height: size,
          decoration:
              const BoxDecoration(color: Colors.white, shape: BoxShape.circle),
        ),
        Container(
          width: avatarSize,
          height: avatarSize,
          decoration: BoxDecoration(
              shape: BoxShape.circle,
              image: DecorationImage(image: AssetImage(imageURL),fit: BoxFit.cover)),
        )
      ],
    );
  }
}
